home *** CD-ROM | disk | FTP | other *** search
/ Rat Attack (UK) (Digital Press Kit - Summer '99) / Rat Attack (UK) (Digital Press Kit - Summer '99).bin / RAT01.DIR / 00063_Script_Go to Frame < prev    next >
Text File  |  1999-04-26  |  2KB  |  50 lines

  1. -- Frame   Go to/Play Number
  2.  
  3. -- nav
  4. -- behavior library version 1.1
  5. -- drag to a sprite or a frame
  6. -- goto a frame on author selected event
  7. -- also functions through lingo by handling message 'initGotoFrame', 
  8. -- for example if this behavior was assigned to sprite 5, use
  9. -- sendsprite 5, #initGotoFrame
  10.  
  11.  
  12. property  whichFrame, whichEvent, playmode
  13.  
  14. on initGotoFrame me
  15.   init me
  16. end
  17.  
  18. on mouseUp me
  19.   if whichEvent = #mouseup    then init me
  20. end
  21.  
  22. on prepareFrame me
  23.   if whichEvent = #prepareframe then init me
  24. end
  25.  
  26. on exitFrame me
  27.   if whichEvent = #exitframe  then init me
  28. end
  29.  
  30. on init me
  31.   if the playmode of me = #"Play and Return" then
  32.     play frame (the whichframe of me)
  33.   else   
  34.     go frame (the whichframe of me)   
  35.   end if
  36. end
  37.  
  38. ---
  39.  
  40. on getPropertyDescriptionList  
  41.   set p_list = [     #WhichFrame: [ #comment:   "Destination Frame:",                     #format:   #integer,                    #default:    1 ],     #WhichEvent: [ #comment:   "Initializing Event:",                     #format:   #symbol,                      #range: [ #MouseUp, #PrepareFrame, #ExitFrame, #InitGotoFrame],                    #default:   #MouseUp ],       #playMode: [ #comment:   "Play Mode:",                     #format:   #symbol,                      #range: [ #"Go to", #"Play and Return" ],                    #default:   #"Go to" ]   ]
  42.   return p_list
  43.   
  44. end
  45.  
  46. on getBehaviorDescription
  47.   return "Moves the Playback Head to the designated frame when the specified event occurs.  Drag to a sprite or frame in the script channel." && RETURN & "PARAMETERS:" && RETURN & "ò Destination Frame - Enter the number of the desired frame."  && RETURN & "ò Initializing Event - Choose the event that triggers the behavior." && RETURN & "ò Play Mode - Choose Play and Return to make the Playback Head return to the current location when the Play Done behavior is encountered. Choose Go To to make the Playback Head continue from the specified frame until explicitly sent to a new location."
  48. end
  49.  
  50.